package ar.com.ford.it.fullEconomics.facade;

import java.util.Collection;
import ar.com.ford.it.fullEconomics.exception.FullEconomicsException;
import ar.com.ford.it.fullEconomics.logic.SupplyLogic;
import ar.com.ford.it.fullEconomics.persistence.dto.Teesp04Supply;
import ar.com.ford.it.fullEconomics.struct.SupplyStruct;
import ar.com.ford.it.fullEconomics.wslx.FullEconomicsWslxUser;

public class SupplyFacade {
    /**
     * Busca Economic Sources seg�n code y name
     * 
     * @param code
     * @param name
     * @return
     * @throws FullEconomicsException
     */
    public Collection<SupplyStruct> findSupply(Teesp04Supply supply)
            throws FullEconomicsException {
        SupplyLogic logic = new SupplyLogic();
        Collection<SupplyStruct> ret = logic.findSupply(supply);

        return ret;
    }
/**
 * Creaca Supply
 * @param supply
 * @param user
 * @throws FullEconomicsException
 */
    public void createSupply(Teesp04Supply supply, FullEconomicsWslxUser user)throws FullEconomicsException {
        SupplyLogic logic = new SupplyLogic();
        logic.createSupply(supply,user);
    }
    /**
     * Elimna un Supply Seleccionado
     * @param supply
     * @param user
     * @throws FullEconomicsException
     */
    public void deletedSupply(Teesp04Supply supply, FullEconomicsWslxUser user)throws FullEconomicsException {
        SupplyLogic logic = new SupplyLogic();
        logic.deletedSupply(supply);
    }
    
    /**
     * Actualiza
     * @param supply
     * @param user
     * @throws FullEconomicsException
     */
    public void updateSupply(Teesp04Supply supply, FullEconomicsWslxUser user)throws FullEconomicsException {
        SupplyLogic logic = new SupplyLogic();
        logic.updateSupply(supply,user);
    }
    /**
     * Buscador de todos los supply
     * @param supply
     * @return
     * @throws FullEconomicsException
     */
    public Collection<Teesp04Supply> findAllSupply(Teesp04Supply supply)throws FullEconomicsException {
        SupplyLogic logic = new SupplyLogic();
        return logic.findAllSupply(supply);
    }
    
    public Teesp04Supply getSupplyByPk (Teesp04Supply supply)throws FullEconomicsException {
        SupplyLogic logic = new SupplyLogic();
        return logic.getSupplyByPk(supply);        
    }
}
